#app {

  .main-container {
    height: 100%;
    transition: margin-left .28s;
    margin-left: $base-sidebar-width;
    position: relative;
  }

  .sidebarHide {
    margin-left: 0!important;
  }

  .sidebar-container {
    -webkit-transition: width .28s;
    transition: width 0.28s;
    width: $base-sidebar-width !important;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    -webkit-box-shadow: 4px 0 12px rgba(0,21,41,.15);
    box-shadow: 4px 0 12px rgba(0,21,41,.15);

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 60px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 12px;
      color: rgba(255, 255, 255, 0.8);
      transition: color 0.3s ease;
      font-size: 18px;
      width: 20px;
      height: 20px;
      flex-shrink: 0;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
      background: transparent;
    }

    .el-menu-item, .menu-title {
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
      color: rgba(255, 255, 255, 0.85) !important;
      background: transparent !important;
      border-radius: 8px !important;
      margin: 4px 4px !important;
      padding: 0 16px !important;
      transition: all 0.3s ease !important;
      font-weight: 500 !important;
      min-height: 48px !important;
      display: flex !important;
      align-items: center !important;

      &:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
        transform: translateX(4px);

        .svg-icon {
          color: #fff;
        }
      }

      &.is-active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: #fff !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;

        .svg-icon {
          color: #fff;
        }
      }
    }

    .el-menu-item .el-menu-tooltip__trigger {
      display: flex !important;
      align-items: center !important;
      width: 100% !important;
    }

    // menu hover
    .sub-menu-title-noDropdown,
    .el-sub-menu__title {
      color: rgba(255, 255, 255, 0.85) !important;
      background: transparent !important;
      border-radius: 8px !important;
      margin: 4px 12px !important;
      padding: 0 16px !important;
      transition: all 0.3s ease !important;
      font-weight: 500 !important;
      min-height: 48px !important;
      display: flex !important;
      align-items: center !important;

      &:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
        transform: translateX(4px);

        .svg-icon {
          color: #fff;
        }
      }

      .svg-icon {
        color: rgba(255, 255, 255, 0.8);
        transition: color 0.3s ease;
      }
    }

    & .theme-dark .is-active > .el-sub-menu__title {
      color: #fff !important;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }

    & .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: $base-sidebar-width !important;
      background: transparent !important;
      color: rgba(255, 255, 255, 0.75) !important;
      padding-left: 48px !important;
      border-radius: 8px !important;
      margin: 2px 12px !important;
      font-size: 13px !important;

      &:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        color: #fff !important;
        transform: translateX(4px);
      }

      &.is-active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: #fff !important;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
      }
    }

    & .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .theme-dark .el-sub-menu .el-menu-item {
      background: transparent !important;

      &:hover {
        background: rgba(255, 255, 255, 0.08) !important;
      }
    }

    // 子菜单展开样式
    .el-sub-menu {
      &.is-opened {
        > .el-sub-menu__title {
          background: rgba(255, 255, 255, 0.05) !important;
        }
      }
    }

    // 菜单分隔线
    .el-menu-item-group__title {
      color: rgba(255, 255, 255, 0.5) !important;
      font-size: 12px !important;
      padding: 12px 16px 8px !important;
      font-weight: 600 !important;
      text-transform: uppercase !important;
      letter-spacing: 0.5px !important;
    }

    // 菜单项内容布局
    .menu-item-content {
      display: flex !important;
      align-items: center !important;
      width: 100% !important;
      overflow: hidden !important;

      .menu-icon {
        margin-right: 12px !important;
        flex-shrink: 0 !important;
        width: 20px !important;
        height: 20px !important;
        text-align: center !important;
        font-size: 18px !important;
      }

      .menu-title {
        flex: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1.5 !important;
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 64px !important;

      .menu-item-content {
        justify-content: center !important;

        .menu-icon {
          margin-right: 0 !important;
        }

        .menu-title {
          display: none !important;
        }
      }

      .svg-icon {
        margin-right: 0 !important;
        margin-left: 0 !important;
      }
    }

    .main-container {
      margin-left: 64px;
    }

    .sub-menu-title-noDropdown {
      padding: 0 !important;
      position: relative;
      justify-content: center !important;

      .el-tooltip {
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;

        .svg-icon {
          margin-left: 0 !important;
          margin-right: 0 !important;
        }
      }
    }

    .el-sub-menu {
      overflow: hidden;

      &>.el-sub-menu__title {
        padding: 0 !important;
        justify-content: center !important;

        .svg-icon {
          margin-left: 0 !important;
          margin-right: 0 !important;
        }

        .menu-item-content {
          justify-content: center !important;

          .menu-title {
            display: none !important;
          }
        }
      }
    }

    .el-menu--collapse {
      .el-sub-menu {
        &>.el-sub-menu__title {
          &>span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
          &>i {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $base-sidebar-width !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $base-sidebar-width !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$base-sidebar-width, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  &>.el-menu {
    .svg-icon {
      margin-right: 12px;
    }
  }

  .nest-menu .el-sub-menu>.el-sub-menu__title,
  .el-menu-item {
    &:hover {
      // you can use $sub-menuHover
      background-color: rgba(0, 0, 0, 0.06) !important;
    }
  }

  // the scroll bar appears when the sub-menu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
